import PureSettingsForm from '../../components/unit-config-forms/settings';
import { getFetchStatus } from 'actions/util';
import * as RunnableUnitAction from 'actions/runnable-unit';
import * as ReactRedux from 'react-redux';

const mapStateToProps = (state) => {
  return {
    updateFetching: getFetchStatus(state, RunnableUnitAction.updateUnitSettings)
  };
};
const mapDispatchToProps = (dispatch) => {
  return {
    onUnitSettingsUpdate: (unitId, conf) => {
      return dispatch(RunnableUnitAction.updateUnitSettings(unitId, conf));
    }
  };
};

export default ReactRedux.connect(mapStateToProps, mapDispatchToProps)(PureSettingsForm);
